home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ctop12b.zip / CTOPUNIT.PAS < prev    next >
Pascal/Delphi Source File  |  1989-03-05  |  20KB  |  934 lines

  1. {
  2.     CTOPUNIT    LastMod     6 Mar 89  SAC
  3.             Created  6 Oct 88  SAC
  4.  
  5. ##############################################################################
  6.  
  7.     This unit contains the standard routines needed to support
  8.     programs translated by CtoP.
  9.  
  10.     (c) 1988, 1989 Knowledge Software Ltd.
  11.  
  12.     Permission is given to amend and distribute this source provided
  13.     that this copyright header is always included.
  14.  
  15. ##############################################################################
  16. }
  17.  
  18. Unit CtoPunit;
  19.  
  20. Interface
  21.  
  22. Const
  23.     Char_Size    = 1;
  24.  
  25. Type
  26.     UnsLongint    = Longint;
  27. {$IFOPT N+}
  28.     LDouble        = Double;
  29. {$ENDIF}
  30.     LLongint    = Longint;
  31.     UnsLLongint    = UnsLongint;
  32.     SWord        = Word;
  33.     SInteger    = Integer;
  34.     SgnChar        = Char;
  35.     UnsChar        = Char;
  36.  
  37. Function If_Then_Else(Condition : Boolean;
  38.               True_Exp  : Longint;
  39.               False_Exp : Longint) : Longint;
  40.  
  41. Function ITE_Bool(Condition : Boolean;
  42.           True_Exp  : Boolean;
  43.           False_Exp : Boolean) : Longint;
  44.  
  45. Function ITE_C(Condition : Boolean) : Boolean;
  46.  
  47. Function ITE_T(True_Exp : Longint) : Boolean;
  48.  
  49. Function ITE_E(False_Exp : Longint) : Boolean;
  50.  
  51. Function SEq_Char(Var Target;
  52.               Source : Char) : Char;
  53.  
  54. Function SEq_SgnChar(Var Target;
  55.                  Source : SgnChar) : SgnChar;
  56.  
  57. Function SEq_UnsChar(Var Target;
  58.                  Source : UnsChar) : UnsChar;
  59.  
  60. Function SEq_Word(Var Target;
  61.               Source : Word) : Word;
  62.  
  63. Function SEq_Integer(Var Target;
  64.              Source : Integer) : Integer;
  65.  
  66. Function SEq_SInteger(Var Target;
  67.               Source : SInteger) : SInteger;
  68.  
  69. Function SEq_Longint(Var Target;
  70.              Source : Longint) : Longint;
  71.  
  72. Function SEq_Pointer(Var Target;
  73.              Source : Pointer) : Pointer;
  74.  
  75. {$IFOPT N+}
  76. Function SEq_Double(Var Target;
  77.             Source : Double) : Double;
  78.  
  79. Function SEq_Single(Var Target;
  80.             Source : Single) : Single;
  81. {$ELSE}
  82. Function SEq_Real(Var Target;
  83.               Source : Real) : Real;
  84. {$ENDIF}
  85.  
  86. Function PoI_Integer(Var Variable) : Integer;
  87.  
  88. Function PoI_SInteger(Var Variable) : SInteger;
  89.  
  90. Function PoI_Word(Var Variable) : Word;
  91.  
  92. Function PoI_SWord(Var Variable) : SWord;
  93.  
  94. Function PoI_Longint(Var Variable) : Longint;
  95.  
  96. Function PoI_Char(Var Variable) : Char;
  97.  
  98. Function PoI_SgnChar(Var Variable) : SgnChar;
  99.  
  100. Function PoI_UnsChar(Var Variable) : UnsChar;
  101.  
  102. Function PoI_Pointer(Var Variable;
  103.              Amount   : Integer) : Pointer;
  104.  
  105. Function PoD_Integer(Var Variable) : Integer;
  106.  
  107. Function PoD_SInteger(Var Variable) : SInteger;
  108.  
  109. Function PoD_Word(Var Variable) : Word;
  110.  
  111. Function PoD_SWord(Var Variable) : SWord;
  112.  
  113. Function PoD_Longint(Var Variable) : Longint;
  114.  
  115. Function PoD_Char(Var Variable) : Char;
  116.  
  117. Function PoD_SgnChar(Var Variable) : SgnChar;
  118.  
  119. Function PoD_UnsChar(Var Variable) : UnsChar;
  120.  
  121. Function PoD_Pointer(Var Variable;
  122.              Amount   : Integer) : Pointer;
  123.  
  124. Function PrI_Integer(Var Variable) : Integer;
  125.  
  126. Function PrI_SInteger(Var Variable) : SInteger;
  127.  
  128. Function PrI_Word(Var Variable) : Word;
  129.  
  130. Function PrI_SWord(Var Variable) : SWord;
  131.  
  132. Function PrI_Longint(Var Variable) : Longint;
  133.  
  134. Function PrI_Char(Var Variable) : Char;
  135.  
  136. Function PrI_SgnChar(Var Variable) : SgnChar;
  137.  
  138. Function PrI_UnsChar(Var Variable) : UnsChar;
  139.  
  140. Function PrI_Pointer(Var Variable;
  141.              Amount   : Integer) : Pointer;
  142.  
  143. Function PrD_Integer(Var Variable) : Integer;
  144.  
  145. Function PrD_SInteger(Var Variable) : SInteger;
  146.  
  147. Function PrD_Word(Var Variable) : Word;
  148.  
  149. Function PrD_SWord(Var Variable) : SWord;
  150.  
  151. Function PrD_Longint(Var Variable) : Longint;
  152.  
  153. Function PrD_Char(Var Variable) : Char;
  154.  
  155. Function PrD_SgnChar(Var Variable) : SgnChar;
  156.  
  157. Function PrD_UnsChar(Var Variable) : UnsChar;
  158.  
  159. Function PrD_Pointer(Var Variable;
  160.              Amount   : Integer) : Pointer;
  161.  
  162. Procedure Inc_Pointer(Var Variable;
  163.               Amount   : Integer);
  164.  
  165. Procedure Dec_Pointer(Var Variable;
  166.               Amount   : Integer);
  167.  
  168. Function StrAddr(ActualStr : String) : Pointer;
  169.  
  170. Function Add_Eq_Word(Var Left; Right : Integer) : Integer;
  171. Function Sub_Eq_Word(Var Left; Right : Integer) : Integer;
  172. Function Mul_Eq_Word(Var Left; Right : Integer) : Integer;
  173. Function Div_Eq_Word(Var Left; Right : Integer) : Integer;
  174. Function Mod_Eq_Word(Var Left; Right : Integer) : Integer;
  175. Function And_Eq_Word(Var Left; Right : Integer) : Integer;
  176. Function Or_Eq_Word(Var Left; Right : Integer) : Integer;
  177. Function Xor_Eq_Word(Var Left; Right : Integer) : Integer;
  178. Function Lsh_Eq_Word(Var Left; Right : Integer) : Integer;
  179. Function Rsh_Eq_Word(Var Left; Right : Integer) : Integer;
  180.  
  181. Function Add_Eq_SWord(Var Left; Right : Integer) : Integer;
  182. Function Sub_Eq_SWord(Var Left; Right : Integer) : Integer;
  183. Function Mul_Eq_SWord(Var Left; Right : Integer) : Integer;
  184. Function Div_Eq_SWord(Var Left; Right : Integer) : Integer;
  185. Function Mod_Eq_SWord(Var Left; Right : Integer) : Integer;
  186. Function And_Eq_SWord(Var Left; Right : Integer) : Integer;
  187. Function Or_Eq_SWord(Var Left; Right : Integer) : Integer;
  188. Function Xor_Eq_SWord(Var Left; Right : Integer) : Integer;
  189. Function Lsh_Eq_SWord(Var Left; Right : Integer) : Integer;
  190. Function Rsh_Eq_SWord(Var Left; Right : Integer) : Integer;
  191.  
  192. Function Add_Eq_Integer(Var Left; Right : Integer) : Integer;
  193. Function Sub_Eq_Integer(Var Left; Right : Integer) : Integer;
  194. Function Mul_Eq_Integer(Var Left; Right : Integer) : Integer;
  195. Function Div_Eq_Integer(Var Left; Right : Integer) : Integer;
  196. Function Mod_Eq_Integer(Var Left; Right : Integer) : Integer;
  197. Function And_Eq_Integer(Var Left; Right : Integer) : Integer;
  198. Function Or_Eq_Integer(Var Left; Right : Integer) : Integer;
  199. Function Xor_Eq_Integer(Var Left; Right : Integer) : Integer;
  200. Function Lsh_Eq_Integer(Var Left; Right : Integer) : Integer;
  201. Function Rsh_Eq_Integer(Var Left; Right : Integer) : Integer;
  202.  
  203. Function Add_Eq_Pointer(Var Left; Right : Integer) : Pointer;
  204. Function Sub_Eq_Pointer(Var Left; Right : Integer) : Pointer;
  205.  
  206. Procedure Add_SEq_Word(Var Left; Right : Integer);
  207. Procedure Sub_SEq_Word(Var Left; Right : Integer);
  208. Procedure Mul_SEq_Word(Var Left; Right : Integer);
  209. Procedure Div_SEq_Word(Var Left; Right : Integer);
  210. Procedure Mod_SEq_Word(Var Left; Right : Integer);
  211. Procedure And_SEq_Word(Var Left; Right : Integer);
  212. Procedure Or_SEq_Word(Var Left; Right : Integer);
  213. Procedure Xor_SEq_Word(Var Left; Right : Integer);
  214. Procedure Lsh_SEq_Word(Var Left; Right : Integer);
  215. Procedure Rsh_SEq_Word(Var Left; Right : Integer);
  216.  
  217. Procedure Add_SEq_Integer(Var Left; Right : Integer);
  218. Procedure Sub_SEq_Integer(Var Left; Right : Integer);
  219. Procedure Mul_SEq_Integer(Var Left; Right : Integer);
  220. Procedure Div_SEq_Integer(Var Left; Right : Integer);
  221. Procedure Mod_SEq_Integer(Var Left; Right : Integer);
  222. Procedure And_SEq_Integer(Var Left; Right : Integer);
  223. Procedure Or_SEq_Integer(Var Left; Right : Integer);
  224. Procedure Xor_SEq_Integer(Var Left; Right : Integer);
  225. Procedure Lsh_SEq_Integer(Var Left; Right : Integer);
  226. Procedure Rsh_SEq_Integer(Var Left; Right : Integer);
  227.  
  228. Procedure Add_SEq_Pointer(Var Left; Right : Integer);
  229. Procedure Sub_SEq_Pointer(Var Left; Right : Integer);
  230.  
  231. Function Comma_Integer(Left, Right : Integer) : Integer;
  232.  
  233. {$IFOPT N+}
  234. Function Float(Value : Longint) : Double;
  235. {$ELSE}
  236. Function Float(Value : Longint) : Real;
  237. {$ENDIF}
  238.  
  239. {
  240.     Now some dummy variables that can be used to
  241.     'throw away' results of functions
  242. }
  243. Var
  244.     Dummy_Char    : Char;
  245.     Dummy_Integer    : Integer;
  246.     Dummy_SInteger    : SInteger;
  247.     Dummy_Word    : Word;
  248.     Dummy_SWord    : SWord;
  249.     Dummy_Longint    : Longint;
  250.     Dummy_LLongint    : LLongint;
  251. {$IFOPT N+}
  252.     Dummy_Single    : Single;
  253.     Dummy_Double    : Double;
  254.     Dummy_LDouble    : LDouble;
  255. {$ELSE}
  256.     Dummy_Real    : Real;
  257. {$ENDIF}
  258.     Dummy_Void    : Integer;
  259.     Dummy_Pointer    : Pointer;
  260.     Dummy_SgnChar    : SgnChar;
  261.     Dummy_UnsChar    : UnsChar;
  262. {
  263.     Other support variables:
  264. }
  265.     ITE_Cnd        : Boolean;    { used by ITE_Bool }
  266.  
  267. Implementation
  268.  
  269. Var
  270.     IFE_Then,
  271.     IFE_Else    : Longint;    { values of long-winded IFE tests }
  272.  
  273. Function ITE_Bool;
  274. Begin
  275. If ITE_Cnd Then
  276.   ITE_Bool := IFE_Then
  277. Else
  278.   ITE_Bool := IFE_Else;
  279. End; { ITE_Bool }
  280.  
  281. Function If_Then_Else;
  282. Begin
  283. If Condition Then
  284.   If_Then_Else := True_Exp
  285. Else
  286.   If_Then_Else := False_Exp;
  287. End; { If_Then_Else }
  288.  
  289. Function ITE_C;
  290. Begin
  291. ITE_C := Condition;
  292. ITE_Cnd := Condition;
  293. End; { ITE_C }
  294.  
  295. Function ITE_T;
  296. Begin
  297. IFE_Then := True_Exp;
  298. ITE_T := True;
  299. End; { ITE_T }
  300.  
  301. Function ITE_E;
  302. Begin
  303. IFE_Else := False_Exp;
  304. ITE_E := False;
  305. End; { ITE_E }
  306.  
  307. Function SEq_Char;
  308. Begin
  309. Char(Target) := Source;
  310. SEq_Char := Source;
  311. End; { SEq_Char }
  312.  
  313. Function SEq_UnsChar;
  314. Begin
  315. UnsChar(Target) := Source;
  316. SEq_UnsChar := Source;
  317. End; { SEq_UnsChar }
  318.  
  319. Function SEq_SgnChar;
  320. Begin
  321. SgnChar(Target) := Source;
  322. SEq_SgnChar := Source;
  323. End; { SEq_SgnChar }
  324.  
  325. Function SEq_Word;
  326. Begin
  327. Word(Target) := Source;
  328. SEq_Word := Source;
  329. End; { SEq_Word }
  330.  
  331. Function SEq_Integer;
  332. Begin
  333. Integer(Target) := Source;
  334. SEq_Integer := Source;
  335. End; { SEq_Integer }
  336.  
  337. Function SEq_SInteger;
  338. Begin
  339. SInteger(Target) := Source;
  340. SEq_SInteger := Source;
  341. End; { SEq_Integer }
  342.  
  343. Function SEq_Longint;
  344. Begin
  345. Longint(Target) := Source;
  346. SEq_Longint := Source;
  347. End; { SEq_Longint }
  348.  
  349. Function SEq_Pointer;
  350. Begin
  351. Pointer(Target) := Source;
  352. SEq_Pointer := Source;
  353. End; { SEq_Pointer }
  354.  
  355. {$IFOPT N+}
  356. Function SEq_Double;
  357. Begin
  358. Double(Target) := Source;
  359. SEq_Double := Source;
  360. End; { SEq_Double }
  361.  
  362. Function SEq_Single;
  363. Begin
  364. Single(Target) := Source;
  365. SEq_Single := Source;
  366. End; { SEq_Single }
  367. {$ELSE}
  368. Function SEq_Real;
  369. Begin
  370. Real(Target) := Source;
  371. SEq_Real := Source;
  372. End; { SEq_Real }
  373. {$ENDIF}
  374.  
  375. Function PoI_Integer;
  376. Begin
  377. PoI_Integer := Integer(Variable);
  378. Integer(Variable) := Integer(Variable) + 1;
  379. End; { PoI_Integer }
  380.  
  381. Function PoI_SInteger;
  382. Begin
  383. PoI_SInteger := SInteger(Variable);
  384. SInteger(Variable) := SInteger(Variable) + 1;
  385. End; { PoI_SInteger }
  386.  
  387. Function PoI_Longint;
  388. Begin
  389. PoI_Longint := Longint(Variable);
  390. LongInt(Variable) := Longint(Variable) + 1;
  391. End; { PoI_Longint }
  392.  
  393. Function PoI_Char;
  394. Begin
  395. PoI_Char := Char(Variable);
  396. Byte(Variable) := Byte(Variable) + 1;
  397. End; { PoI_Char }
  398.  
  399. Function PoI_SgnChar;
  400. Begin
  401. PoI_SgnChar := SgnChar(Variable);
  402. Byte(Variable) := Byte(Variable) + 1;
  403. End; { PoI_SgnChar }
  404.  
  405. Function PoI_UnsChar;
  406. Begin
  407. PoI_UnsChar := UnsChar(Variable);
  408. Byte(Variable) := Byte(Variable) + 1;
  409. End; { PoI_UnsChar }
  410.  
  411. Function PoI_Pointer;
  412. Begin
  413. PoI_Pointer := Pointer(Variable);
  414. Longint(Variable) := Longint(Variable) + Amount;
  415. End; { PoI_Pointer }
  416.  
  417. Function PoI_Word;
  418. Begin
  419. PoI_Word := Word(Variable);
  420. Word(Variable) := Word(Variable) + 1;
  421. End; { PoI_Word }
  422.  
  423. Function PoI_SWord;
  424. Begin
  425. PoI_SWord := SWord(Variable);
  426. SWord(Variable) := SWord(Variable) + 1;
  427. End; { PoI_SWord }
  428.  
  429. Function PoD_Integer;
  430. Begin
  431. PoD_Integer := Integer(Variable);
  432. Integer(Variable) := Integer(Variable) - 1;
  433. End; { PoD_Integer }
  434.  
  435. Function PoD_SInteger;
  436. Begin
  437. PoD_SInteger := SInteger(Variable);
  438. SInteger(Variable) := SInteger(Variable) - 1;
  439. End; { PoD_SInteger }
  440.  
  441. Function PoD_Longint;
  442. Begin
  443. PoD_Longint := Longint(Variable);
  444. Longint(Variable) := Longint(Variable) - 1;
  445. End; { PoD_Longint }
  446.  
  447. Function PoD_Char;
  448. Begin
  449. PoD_Char := Char(Variable);
  450. Byte(Variable) := Byte(Variable) - 1;
  451. End; { PoD_Char }
  452.  
  453. Function PoD_SgnChar;
  454. Begin
  455. PoD_SgnChar := SgnChar(Variable);
  456. Byte(Variable) := Byte(Variable) - 1;
  457. End; { PoD_SgnChar }
  458.  
  459. Function PoD_UnsChar;
  460. Begin
  461. PoD_UnsChar := UnsChar(Variable);
  462. Byte(Variable) := Byte(Variable) - 1;
  463. End; { PoD_UnsChar }
  464.  
  465. Function PoD_Pointer;
  466. Begin
  467. PoD_Pointer := Pointer(Variable);
  468. Longint(Variable) := Longint(Variable) - Amount;
  469. End; { PoD_Pointer }
  470.  
  471. Function PoD_Word;
  472. Begin
  473. PoD_Word := Word(Variable);
  474. Word(Variable) := Word(Variable) - 1;
  475. End; { PoD_Word }
  476.  
  477. Function PoD_SWord;
  478. Begin
  479. PoD_SWord := SWord(Variable);
  480. SWord(Variable) := SWord(Variable) - 1;
  481. End; { PoD_SWord }
  482.  
  483. Function PrI_Integer;
  484. Begin
  485. Integer(Variable) := Integer(Variable) + 1;
  486. PrI_Integer := Integer(Variable);
  487. End; { PrI_Integer }
  488.  
  489. Function PrI_SInteger;
  490. Begin
  491. SInteger(Variable) := SInteger(Variable) + 1;
  492. PrI_SInteger := SInteger(Variable);
  493. End; { PrI_SInteger }
  494.  
  495. Function PrI_Longint;
  496. Begin
  497. Longint(Variable) := Longint(Variable) + 1;
  498. PrI_Longint := Longint(Variable);
  499. End; { PrI_Longint }
  500.  
  501. Function PrI_Char;
  502. Begin
  503. Byte(Variable) := Byte(Variable) + 1;
  504. PrI_Char := Char(Variable);
  505. End; { PrI_Char }
  506.  
  507. Function PrI_SgnChar;
  508. Begin
  509. Byte(Variable) := Byte(Variable) + 1;
  510. PrI_SgnChar := SgnChar(Variable);
  511. End; { PrI_SgnChar }
  512.  
  513. Function PrI_UnsChar;
  514. Begin
  515. Byte(Variable) := Byte(Variable) + 1;
  516. PrI_UnsChar := UnsChar(Variable);
  517. End; { PrI_UnsChar }
  518.  
  519. Function PrI_Pointer;
  520. Begin
  521. Longint(Variable) := Longint(Variable) + Amount;
  522. PrI_Pointer := Pointer(Variable);
  523. End; { PrI_Pointer }
  524.  
  525. Function PrI_Word;
  526. Begin
  527. Word(Variable) := Word(Variable) + 1;
  528. PrI_Word := Word(Variable);
  529. End; { PrI_Word }
  530.  
  531. Function PrI_SWord;
  532. Begin
  533. SWord(Variable) := SWord(Variable) + 1;
  534. PrI_SWord := SWord(Variable);
  535. End; { PrI_SWord }
  536.  
  537. Function PrD_Integer;
  538. Begin
  539. Integer(Variable) := Integer(Variable) - 1;
  540. PrD_Integer := Integer(Variable);
  541. End; { PrD_Integer }
  542.  
  543. Function PrD_SInteger;
  544. Begin
  545. SInteger(Variable) := SInteger(Variable) - 1;
  546. PrD_SInteger := SInteger(Variable);
  547. End; { PrD_Integer }
  548.  
  549. Function PrD_Longint;
  550. Begin
  551. Longint(Variable) := Longint(Variable) - 1;
  552. PrD_Longint := Longint(Variable);
  553. End; { PrD_Longint }
  554.  
  555. Function PrD_Char;
  556. Begin
  557. Byte(Variable) := Byte(Variable) - 1;
  558. PrD_Char := Char(Variable);
  559. End; { PrD_Char }
  560.  
  561. Function PrD_SgnChar;
  562. Begin
  563. Byte(Variable) := Byte(Variable) - 1;
  564. PrD_SgnChar := SgnChar(Variable);
  565. End; { PrD_SgnChar }
  566.  
  567. Function PrD_UnsChar;
  568. Begin
  569. Byte(Variable) := Byte(Variable) - 1;
  570. PrD_UnsChar := UnsChar(Variable);
  571. End; { PrD_UnsChar }
  572.  
  573. Function PrD_Pointer;
  574. Begin
  575. Longint(Variable) := Longint(Variable) - Amount;
  576. PrD_Pointer := Pointer(Variable);
  577. End; { PrD_Pointer }
  578.  
  579. Function PrD_Word;
  580. Begin
  581. Word(Variable) := Word(Variable) - 1;
  582. PrD_Word := Word(Variable);
  583. End; { PrD_Word }
  584.  
  585. Function PrD_SWord;
  586. Begin
  587. SWord(Variable) := SWord(Variable) - 1;
  588. PrD_SWord := SWord(Variable);
  589. End; { PrD_SWord }
  590.  
  591. Procedure Inc_Pointer;
  592. Begin
  593. Longint(Variable) := Longint(Variable) + Amount;
  594. End; { Inc_Pointer }
  595.  
  596. Procedure Dec_Pointer;
  597. Begin
  598. Longint(Variable) := Longint(Variable) - Amount;
  599. End; { Dec_Pointer }
  600.  
  601. Function StrAddr;
  602. {
  603.     Given a string, we must somehow return the 'address' of it.
  604.  
  605.     About the only way to do this, is to allocate space on the
  606.     heap, copy the string in and return that address.  Note that
  607.     excessive use of StrAddr will cause a heap overflow!
  608. }
  609. Var
  610.     HeapStr    : ^String;
  611. Begin
  612. GetMem(Pointer(HeapStr), 1 + Word(Length(ActualStr)));
  613.     { we grab enough memory for the string & its length byte }
  614. HeapStr^ := ActualStr;
  615.     { copy the string to the heap }
  616. StrAddr := HeapStr;
  617.     { return the 'address of the string' }
  618. End; { StrAddr }
  619.  
  620. Function Add_Eq_Word;
  621. Begin
  622. Word(Left) := Word(Left) + Right;
  623. Add_Eq_Word := Word(Left);
  624. End;
  625.  
  626. Function Sub_Eq_Word;
  627. Begin
  628. Word(Left) := Word(Left) - Right;
  629. Sub_Eq_Word := Word(Left);
  630. End;
  631.  
  632. Function Mul_Eq_Word;
  633. Begin
  634. Word(Left) := Word(Left) * Right;
  635. Mul_Eq_Word := Word(Left);
  636. End;
  637.  
  638. Function DIV_Eq_Word;
  639. Begin
  640. Word(Left) := Word(Left) DIV Right;
  641. Div_Eq_Word := Word(Left);
  642. End;
  643.  
  644. Function Mod_Eq_Word;
  645. Begin
  646. Word(Left) := Word(Left) Mod Right;
  647. Mod_Eq_Word := Word(Left);
  648. End;
  649.  
  650. Function And_Eq_Word;
  651. Begin
  652. Word(Left) := Word(Left) AND Right;
  653. And_Eq_Word := Word(Left);
  654. End;
  655.  
  656. Function Or_Eq_Word;
  657. Begin
  658. Word(Left) := Word(Left) OR Right;
  659. Or_Eq_Word := Word(Left);
  660. End;
  661.  
  662. Function Xor_Eq_Word;
  663. Begin
  664. Word(Left) := Word(Left) XOR Right;
  665. Xor_Eq_Word := Word(Left);
  666. End;
  667.  
  668. Function Lsh_Eq_Word;
  669. Begin
  670. Word(Left) := Word(Left) SHL Right;
  671. Lsh_Eq_Word := Word(Left);
  672. End;
  673.  
  674. Function Rsh_Eq_Word;
  675. Begin
  676. Word(Left) := Word(Left) SHR Right;
  677. Rsh_Eq_Word := Word(Left);
  678. End;
  679.  
  680. Function Add_Eq_SWord;
  681. Begin
  682. SWord(Left) := SWord(Left) + Right;
  683. Add_Eq_SWord := SWord(Left);
  684. End;
  685.  
  686. Function Sub_Eq_SWord;
  687. Begin
  688. SWord(Left) := SWord(Left) - Right;
  689. Sub_Eq_SWord := SWord(Left);
  690. End;
  691.  
  692. Function Mul_Eq_SWord;
  693. Begin
  694. SWord(Left) := SWord(Left) * Right;
  695. Mul_Eq_SWord := SWord(Left);
  696. End;
  697.  
  698. Function DIV_Eq_SWord;
  699. Begin
  700. SWord(Left) := SWord(Left) DIV Right;
  701. Div_Eq_SWord := SWord(Left);
  702. End;
  703.  
  704. Function Mod_Eq_SWord;
  705. Begin
  706. SWord(Left) := SWord(Left) Mod Right;
  707. Mod_Eq_SWord := SWord(Left);
  708. End;
  709.  
  710. Function And_Eq_SWord;
  711. Begin
  712. SWord(Left) := SWord(Left) AND Right;
  713. And_Eq_SWord := SWord(Left);
  714. End;
  715.  
  716. Function Or_Eq_SWord;
  717. Begin
  718. SWord(Left) := SWord(Left) OR Right;
  719. Or_Eq_SWord := SWord(Left);
  720. End;
  721.  
  722. Function Xor_Eq_SWord;
  723. Begin
  724. SWord(Left) := SWord(Left) XOR Right;
  725. Xor_Eq_SWord := SWord(Left);
  726. End;
  727.  
  728. Function Lsh_Eq_SWord;
  729. Begin
  730. SWord(Left) := SWord(Left) SHL Right;
  731. Lsh_Eq_SWord := SWord(Left);
  732. End;
  733.  
  734. Function Rsh_Eq_SWord;
  735. Begin
  736. SWord(Left) := SWord(Left) SHR Right;
  737. Rsh_Eq_SWord := SWord(Left);
  738. End;
  739.  
  740. Function Add_Eq_Integer;
  741. Begin
  742. Integer(Left) := Integer(Left) + Right;
  743. Add_Eq_Integer := Integer(Left);
  744. End;
  745.  
  746. Function Sub_Eq_Integer;
  747. Begin
  748. Integer(Left) := Integer(Left) - Right;
  749. Sub_Eq_Integer := Integer(Left);
  750. End;
  751.  
  752. Function Mul_Eq_Integer;
  753. Begin
  754. Integer(Left) := Integer(Left) * Right;
  755. Mul_Eq_Integer := Integer(Left);
  756. End;
  757.  
  758. Function DIV_Eq_Integer;
  759. Begin
  760. Integer(Left) := Integer(Left) DIV Right;
  761. Div_Eq_Integer := Integer(Left);
  762. End;
  763.  
  764. Function Mod_Eq_Integer;
  765. Begin
  766. Integer(Left) := Integer(Left) Mod Right;
  767. Mod_Eq_Integer := Integer(Left);
  768. End;
  769.  
  770. Function And_Eq_Integer;
  771. Begin
  772. Integer(Left) := Integer(Left) AND Right;
  773. And_Eq_Integer := Integer(Left);
  774. End;
  775.  
  776. Function Or_Eq_Integer;
  777. Begin
  778. Integer(Left) := Integer(Left) OR Right;
  779. Or_Eq_Integer := Integer(Left);
  780. End;
  781.  
  782. Function Xor_Eq_Integer;
  783. Begin
  784. Integer(Left) := Integer(Left) XOR Right;
  785. Xor_Eq_Integer := Integer(Left);
  786. End;
  787.  
  788. Function Lsh_Eq_Integer;
  789. Begin
  790. Integer(Left) := Integer(Left) SHL Right;
  791. Lsh_Eq_Integer := Integer(Left);
  792. End;
  793.  
  794. Function Rsh_Eq_Integer;
  795. Begin
  796. Integer(Left) := Integer(Left) SHR Right;
  797. Rsh_Eq_Integer := Integer(Left);
  798. End;
  799.  
  800. Function Add_Eq_Pointer;
  801. Begin
  802. Longint(Left) := Longint(Left) + Right;
  803. Add_Eq_Pointer := Pointer(Left);
  804. End;
  805.  
  806. Function Sub_Eq_Pointer;
  807. Begin
  808. Longint(Left) := Longint(Left) - Right;
  809. Sub_Eq_Pointer := Pointer(Left);
  810. End;
  811.  
  812. Procedure Add_SEq_Word;
  813. Begin
  814. Word(Left) := Word(Left) + Right;
  815. End;
  816.  
  817. Procedure Sub_SEq_Word;
  818. Begin
  819. Word(Left) := Word(Left) - Right;
  820. End;
  821.  
  822. Procedure Mul_SEq_Word;
  823. Begin
  824. Word(Left) := Word(Left) * Right;
  825. End;
  826.  
  827. Procedure DIV_SEq_Word;
  828. Begin
  829. Word(Left) := Word(Left) DIV Right;
  830. End;
  831.  
  832. Procedure Mod_SEq_Word;
  833. Begin
  834. Word(Left) := Word(Left) Mod Right;
  835. End;
  836.  
  837. Procedure And_SEq_Word;
  838. Begin
  839. Word(Left) := Word(Left) AND Right;
  840. End;
  841.  
  842. Procedure Or_SEq_Word;
  843. Begin
  844. Word(Left) := Word(Left) OR Right;
  845. End;
  846.  
  847. Procedure Xor_SEq_Word;
  848. Begin
  849. Word(Left) := Word(Left) XOR Right;
  850. End;
  851.  
  852. Procedure Lsh_SEq_Word;
  853. Begin
  854. Word(Left) := Word(Left) SHL Right;
  855. End;
  856.  
  857. Procedure Rsh_SEq_Word;
  858. Begin
  859. Word(Left) := Word(Left) SHR Right;
  860. End;
  861.  
  862. Procedure Add_SEq_Integer;
  863. Begin
  864. Integer(Left) := Integer(Left) + Right;
  865. End;
  866.  
  867. Procedure Sub_SEq_Integer;
  868. Begin
  869. Integer(Left) := Integer(Left) - Right;
  870. End;
  871.  
  872. Procedure Mul_SEq_Integer;
  873. Begin
  874. Integer(Left) := Integer(Left) * Right;
  875. End;
  876.  
  877. Procedure DIV_SEq_Integer;
  878. Begin
  879. Integer(Left) := Integer(Left) DIV Right;
  880. End;
  881.  
  882. Procedure Mod_SEq_Integer;
  883. Begin
  884. Integer(Left) := Integer(Left) Mod Right;
  885. End;
  886.  
  887. Procedure And_SEq_Integer;
  888. Begin
  889. Integer(Left) := Integer(Left) AND Right;
  890. End;
  891.  
  892. Procedure Or_SEq_Integer;
  893. Begin
  894. Integer(Left) := Integer(Left) OR Right;
  895. End;
  896.  
  897. Procedure Xor_SEq_Integer;
  898. Begin
  899. Integer(Left) := Integer(Left) XOR Right;
  900. End;
  901.  
  902. Procedure Lsh_SEq_Integer;
  903. Begin
  904. Integer(Left) := Integer(Left) SHL Right;
  905. End;
  906.  
  907. Procedure Rsh_SEq_Integer;
  908. Begin
  909. Integer(Left) := Integer(Left) SHR Right;
  910. End;
  911.  
  912. Procedure Add_SEq_Pointer;
  913. Begin
  914. Longint(Left) := Longint(Left) + Right;
  915. End;
  916.  
  917. Procedure Sub_SEq_Pointer;
  918. Begin
  919. Longint(Left) := Longint(Left) - Right;
  920. End;
  921.  
  922. Function Comma_Integer;
  923. Begin
  924. Comma_Integer := Right;
  925. End;
  926.  
  927. Function Float;
  928. Begin
  929. Float := 0.0 + Value;
  930. End;
  931.  
  932. Begin { Unit Initialization }
  933. End.
  934.